<template>
	<view class="mine-container">
		<view class="title">
			{{ title }}
		</view>
		<u-button type="default" @click="logout">退出登录</u-button>
		<u-tabbar :list="tabbar"></u-tabbar>
	</view>
</template>

<script>
	import tabbar from '@/common/mockData/tabbar.js'
	export default {
		data() {
			return {
				title: '学生和教师可见',
				tabbar: tabbar[uni.getStorageSync('role')]
			}
		},
		onLoad() {
		},
		methods: {
			logout() {
				uni.clearStorage()
				uni.redirectTo({
					url: '/pages/login/index'
				})
			}
		}
	}
</script>

<style lang="scss">
	.mine-container {
		padding: 30px;
		.title {
			text-align: center;
			font-size: 36rpx;
			color: #8f8f94;
			margin-bottom: 30px;
		}
	}
</style>
